package com.czy.owner.api;

import com.czy.owner.net.api.BaseApi;
import com.czy.owner.net.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import java.util.HashMap;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by asus on 2017/6/1.
 */

public class BindStoreApi  extends BaseApi {
    private String session;
    private String storeId;

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public BindStoreApi(HttpOnNextListener listener, RxAppCompatActivity rxAppCompatActivity) {
        super(listener, rxAppCompatActivity);
        setCache(false);
        setShowProgress(true);


    }

    public String getSession() {
        return session;
    }

    public void setSession(String session) {
        this.session = session;
    }



    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService service = retrofit.create(HttpPostService.class);
        HashMap<String, Object> map = new HashMap<>();
        map.put("session", getSession());
        map.put("storeId", getStoreId());
        return service.getBindStore(map);
    }
}

